package masterjava.common.dao;

import org.hibernate.Criteria;
import org.hibernate.Query;

import java.io.Serializable;
import java.util.List;

public interface GenericDao<T, ID extends Serializable> {

    T load(ID id);

    T get(ID id);

    ID saveOrUpdate(T entity);

    void refresh(T entity);

    Query getNamedQuery(String queryName);

    void flush();

    List<T> list(Query q);

    List<T> list(Criteria c);

    void delete(T entiry);

    List<T> loadAll();

    Criteria getRootCriteria();

}